<!--
 * @Author: ljc
 * @Date: 2024-08-06 13:40:50
 * @LastEditors: g05047
 * @LastEditTime: 2024-11-25 16:31:45
 * @Description: 区划和单位对齐方式
-->
<template>
  <template v-if="treeType === 'ad'">
    <el-form-item :label="i18nt('designer.setting.adLabelAlign')"
      v-if="!noLabelSetting && (selectedWidget.type !== 'button')">
      <el-radio-group v-model="optionModel.adConfig.adLabelAlign"
        class="radio-group-custom">
        <el-radio-button value="label-left-align">
          {{i18nt('designer.setting.leftAlign')}}</el-radio-button>
        <el-radio-button value="label-center-align">
          {{i18nt('designer.setting.centerAlign')}}</el-radio-button>
        <el-radio-button value="label-right-align">
          {{i18nt('designer.setting.rightAlign')}}</el-radio-button>
      </el-radio-group>
    </el-form-item>
  </template>
  <template v-else>
    <el-form-item :label="i18nt('designer.setting.agLabelAlign')"
      v-if="!noLabelSetting && (selectedWidget.type !== 'button')">
      <el-radio-group v-model="optionModel.agConfig.agLabelAlign"
        class="radio-group-custom">
        <el-radio-button value="label-left-align">
          {{i18nt('designer.setting.leftAlign')}}</el-radio-button>
        <el-radio-button value="label-center-align">
          {{i18nt('designer.setting.centerAlign')}}</el-radio-button>
        <el-radio-button value="label-right-align">
          {{i18nt('designer.setting.rightAlign')}}</el-radio-button>
      </el-radio-group>
    </el-form-item>
  </template>

</template>
<script>
import i18n from "@/utils/i18n"
export default {
  name: "treeLabelAlign-editor",
  mixins: [i18n],
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
    treeType: String,
  },
  computed: {
    noLabelSetting() {
      return (this.selectedWidget.type === 'static-text') || (this.selectedWidget.type === 'html-text')
      //|| (this.selectedWidget.type === 'divider')
    },
  }
}
</script>

<style lang="scss" scoped>
.radio-group-custom {
  :deep(.el-radio-button__inner) {
    padding-left: 12px;
    padding-right: 12px;
  }
}
</style>
